package com.gzceb.zhgjj.security.entity;

// default package

import java.util.HashSet;
import java.util.Set;

import com.gzceb.zhgjj.security.entity.SysRoles;

/**
 * SysRoles entity. @author MyEclipse Persistence Tools
 */

public class SysRoles implements java.io.Serializable {

	// Fields

	private String roleId;
	private String roleName;
	private String roleDesc;
	private Boolean enabled;
	private Boolean issys;
	private String module;
	private Set sysUsersRoleses = new HashSet(0);
	private Set sysRolesAuthoritieses = new HashSet(0);

	// Constructors

	/** default constructor */
	public SysRoles() {
	}

	public SysRoles(String roleId) {
		this.roleId = roleId;
	}

	/** full constructor */
	public SysRoles(String roleId, String roleName, String roleDesc) {
		this.roleId = roleId;
		this.roleName = roleName;
		this.roleDesc = roleDesc;
	}

	public SysRoles(String roleId, String roleName, String roleDesc,
			Boolean enabled, Boolean issys, String module) {
		this.roleId = roleId;
		this.roleName = roleName;
		this.roleDesc = roleDesc;
		this.enabled = enabled;
		this.issys = issys;
		this.module = module;
	}

	public SysRoles(String roleId, String roleName, String roleDesc,
			Boolean enabled, Boolean issys, String module, Set sysUsersRoleses,
			Set sysRolesAuthoritieses) {
		this.roleId = roleId;
		this.roleName = roleName;
		this.roleDesc = roleDesc;
		this.enabled = enabled;
		this.issys = issys;
		this.module = module;
		this.sysUsersRoleses = sysUsersRoleses;
		this.sysRolesAuthoritieses = sysRolesAuthoritieses;
	}

	// Property accessors

	public String getRoleId() {
		return this.roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getRoleDesc() {
		return this.roleDesc;
	}

	public void setRoleDesc(String roleDesc) {
		this.roleDesc = roleDesc;
	}

	public Boolean getEnabled() {
		return this.enabled;
	}

	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}

	public Boolean getIssys() {
		return this.issys;
	}

	public void setIssys(Boolean issys) {
		this.issys = issys;
	}

	public String getModule() {
		return this.module;
	}

	public void setModule(String module) {
		this.module = module;
	}

	public Set getSysUsersRoleses() {
		return this.sysUsersRoleses;
	}

	public void setSysUsersRoleses(Set sysUsersRoleses) {
		this.sysUsersRoleses = sysUsersRoleses;
	}

	public Set getSysRolesAuthoritieses() {
		return this.sysRolesAuthoritieses;
	}

	public void setSysRolesAuthoritieses(Set sysRolesAuthoritieses) {
		this.sysRolesAuthoritieses = sysRolesAuthoritieses;
	}

	/*
	 * 若要把持久类的实例放入Set中(尤其表示多值关联时)，或重用脱管实例， 就要重写该持久类的equals和hashCode。
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object other) {

		if (this == other)
			return true;

		if (!(other instanceof SysRoles))
			return false;

		final SysRoles sysRoles = (SysRoles) other;

		if (!sysRoles.getRoleName().equals(getRoleName()))
			return false;

		if (!sysRoles.getRoleDesc().equals(getRoleDesc()))
			return false;

		return true;

	}

	/*
	 * 重写hashCode()。
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {

		int result;

		result = getRoleName().hashCode();

		result = 29 * result + getRoleDesc().hashCode();

		return result;
	}

}